package xuegao.study.mall.rbac.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import xuegao.study.mall.common.api.CommonResult;
import xuegao.study.mall.rbac.service.UmsAdminLoginLogService;

@Api(tags = "UmsAdminLoginLogController")
@Tag(name = "UmsAdminLoginLogController", description = "用户登录日志管理接口")
@RestController
@RequestMapping(value = "/admin")
public class UmsAdminLoginLogController {

    @Autowired
    private UmsAdminLoginLogService umsAdminLoginLogService;

    @ApiOperation("记录用户登录日志")
    @PostMapping("/log")
    public CommonResult log(@RequestParam String username) {
        return umsAdminLoginLogService.insertLog(username);
    }
}
